<!doctype html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>缤格</title>
    <link rel="stylesheet" type="text/css" href="../../css/api.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/style.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/swiper.min.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/common.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/binge.css"/>
    <script type="text/javascript" src="../../script/jquery-1.9.1.min.js"></script>
    <script type="text/javascript" src="../../script/swiper.min.js"></script>
    <script type="text/javascript" src="../../script/laydate/laydate.js"></script>
    <script type="text/javascript" src="../../script/mobile.js"></script>
    <script type="text/javascript">
        window['adaptive'].desinWidth = 750;
        window['adaptive'].baseFont = 28;
        window['adaptive'].maxWidth = 750;
        window['adaptive'].init();
    </script>
</head>

<body>
<div class="mescroll" id="mescroll" style="-webkit-overflow-scrolling:touch;">
    <div class="activity-index bg-cover" id="activity_img" style="">
        <div id="header">
            <!-- header -->
            <div class="header">
                <div class="head-back">
                    <a href="javascript:void(0);" tapmode onclick="comeBackBar()" class="back-btn-white"></a>
                </div>
                <div class="head-title">
                    <h6 style="color: #fff;">需求详情</h6>
                </div>
                <div class="head-action">
                    <a href="javascript:void(0);" tapmode onclick="openModel()" class="action-btn-white"></a>
                </div>
            </div>
            <!-- header end -->
        </div>

    </div>

    <div class="activity-detail-section">
        <div class="act-title" id="title">音乐爱好者</div>
        <div class="act-detail-list">
            <ul>
                <li>
                    <p class="name icon1">时间</p>
                    <p class="info" id="activity_time"></p>
                </li>
                <li>
                    <p class="name icon1">报名截止时间</p>
                    <p class="info" id="sign_time"></p>
                </li>
                <li>
                    <p class="name icon2">地点</p>
                    <p class="info" id="address">
                        <a href="javascript:void(0);" class="city"></a>
                        <!--<a href="javascript:void(0)" class="address-icon"></a>-->
                    </p>
                </li>
                <li>
                    <p class="name icon3">发起人</p>
                    <p class="info" id="username"></p>
                </li>
                <li>
                    <p class="name icon4">联系方式</p>
                    <p class="info" id="tel"></p>
                </li>
                <li>
                    <p class="name icon5">人数</p>
                    <p class="info" id="num"></p>
                </li>
                <li>
                    <p class="name icon6">费用</p>
                    <p class="info" id="cost"></p>
                </li>
            </ul>
            <div class="act-detail">
                <h6 class="f30">需求介绍</h6>
                <div class="detail multiline-ellipsis" id="content" style="-webkit-line-clamp: 8;"></div>
                <a href="javascript:void(0)" tapmode onclick="activityDetail('activity_detail')" class="look-detail">查看详情
                    ></a>
            </div>
            <!--class: sign1 我要报名，sign2 发布者 ，sign3 已报名-->
            <a href="javascript:void(0)" style="display: none;" id="sign2" class="sign-up sign1 mt45" tapmode
               onclick="userSignAct('activity_sign')">我要报名</a>
            <a href="javascript:void(0)" style="display: none;" id="sign1" class="sign-up sign2 mt45" tapmode
               onclick="userCancelAct()">取消发布</a>
            <a href="javascript:void(0)" style="display: none;" id="sign3" class="sign-up sign3 mt45" tapmode
               onclick="userCancelSign()">取消报名</a>
            <a href="javascript:void(0)" style="display: none;" id="sign4" class="sign-up sign3 mt45">报名截止</a>
            <a href="javascript:void(0)" style="display: none;" id="sign5" class="sign-up sign1 mt45">进行中</a>
            <a href="javascript:void(0)" style="display: none;" id="sign6" class="sign-up sign3 mt45">已结束</a>
            <a href="javascript:void(0)" style="display: none;" id="sign7" class="sign-up sign3 mt45">已取消</a>
        </div>
    </div>


    <div class="comment-section" style="border-top: none;">
        <div class="comment-kinds" style="padding-top: 0; height: 0.67rem;">
            <ul>
                <li tapmode onclick="tabComment(1,this)" class="on"><span>评论</span><em style="margin-left: 0.05rem;"
                                                                                       id="plNum">158</em>
                </li>
                <li tapmode onclick="tabComment(2,this)"><span>报名人员</span> <em style="margin-left: 0.05rem;"
                                                                               id="signNum">0</em>
                </li>
            </ul>
            <!--<div class="screen-btn" tapmode onclick="screen()">按热度</div>-->
        </div>
        <div class="comment-area">
            <div class="comment-list area" style="display: block;">
                <ul id="commentHtml">


                </ul>
                <div class="comment-input">
                    <div class="input-box">
                        <input type="text" id="inputContent" readonly data-pid="" placeholder="写评论...">
                        <!--<button class="send-btn" tapmode onclick="comment_add()">确定</button>-->
                    </div>
                    <div class="comment-count">
                        <div class="count-li collect" id="collect" tapmode onclick="collect(this)">0</div>
                        <div class="count-li love" id="love" tapmode onclick="clickFabulous('',3,'',event)">0</div>
                        <div class="count-li msg" id="msg" tapmode onclick="toAllList()">0</div>
                    </div>
                </div>


            </div>
            <div class="love-list area" style="display: none;">
                <ul class="activity-sign" id="sign_list">
                    <!--<li>
                        <div class="common-user-detail" tapmode onclick="commonUrl('activity_member')">
                            <div class="user-info">
                                <div class="user-icon bg-cover"
                                     style="background-image: url('../../image/img-tx.png');"></div>
                                <div class="info">
                                    <div class="name">
                                        <h6>后来熟悉</h6>
                                        <dl class="badge-list">
                                            <dd class="icon"><img src="../../icon/icon-hz01.png" alt=""></dd>
                                            <dd class="icon"><img src="../../icon/icon-hz02.png" alt=""></dd>
                                            <dd class="icon"><img src="../../icon/icon-hz03.png" alt=""></dd>
                                            <dd class="icon"><img src="../../icon/icon-hz04.png" alt=""></dd>
                                            <dd class="icon"><img src="../../icon/icon-hz05.png" alt=""></dd>
                                        </dl>
                                    </div>
                                    <p class="sign-info single-ellipsis">一直想举办个这样的活动...</p>
                                    <span class="time">3分钟前</span>
                                </div>
                            </div>
                        </div>
                    </li>-->
                </ul>
            </div>
        </div>
    </div>
</div>

<div class="fixed-btn" style="bottom: 1.2rem;">
    <a href="javascript:void(0);" tapmode onclick="loadPage()" class="reload-view"></a>
</div>

<div class="edit-model">
    <div class="edit-input">
        <div class="message-flex">
            <div class="message-box" id="message">
                <div class="message" id="article" contenteditable="true"></div>
            </div>
            <div class="message-img" style="display: none;" id="msgImg">
                <img src="" alt="">
                <span class="delete dn" tapmode onclick="removePic(this,event)"></span>
            </div>
        </div>

        <div class="But">
            <div class="but-list">
                <a href="javascript:void(0);" tapmode onclick="upload()" class="imgBut"></a>
                <a href="javascript:void(0);" tapmode onclick="showVideo()" class="videoBut"></a>
                <a href="javascript:void(0);" tapmode onclick="toAiteList()" class="aiTeBut"></a>
            </div>
            <span class="submit" tapmode onclick="comment_add()">确定</span>
        </div>
    </div>
</div>


<!-- 右上角操作 -->
<div class="action-model model" tapmode onclick="closeModel()">
    <div class="action-view" tapmode onclick="stopModel(event)">
        <h6 class="shareTitle">分享</h6>
        <a href="javascript:void(0);" tapmode onclick="closeModel(event)" class="model-close"></a>
        <div class="model-detail">
            <ul>
                <li tapmode onclick="shareWx(event)" class="threeShare">
                    <div class="share-icon icon1"></div>
                    <p>微信</p>
                </li>
                <li tapmode onclick="shareWxq(event)" class="threeShare">
                    <div class="share-icon icon2"></div>
                    <p>朋友圈</p>
                </li>
                <li tapmode onclick="shareQq(event)" class="threeShare">
                    <div class="share-icon icon3"></div>
                    <p>QQ</p>
                </li>
                <li tapmode onclick="shareQzone(event)" class="threeShare">
                    <div class="share-icon icon4"></div>
                    <p>QQ空间</p>
                </li>
                <li tapmode onclick="shareWb(event)" class="threeShare">
                    <div class="share-icon icon5"></div>
                    <p>微博</p>
                </li>
                <li tapmode class="copy" onclick="copyLink()">
                    <div class="share-icon icon-copy"></div>
                    <p>复制链接</p>
                </li>
                <li tapmode onclick="reportBtn(event)">
                    <div class="share-icon icon-report"></div>
                    <p>举报</p>
                </li>
            </ul>
        </div>
        <!--<div class="shade-user">
            <a href="javascript:void(0);" class="shade-btn"><span>屏蔽此人</span></a>
        </div>-->
    </div>
</div>
<!-- 右上角操作 end -->

<!--评论通用-->
<div class="photoViewerCommon">
    <div class="swiper-container photoViewer-common">
        <ul class="swiper-wrapper">
            <!--<li class="swiper-slide"><img src="../../image/banner01.png" alt=""></li>-->
            <li class="swiper-slide" onclick="closeViewCommon()"><img onclick="showViewCommon(event)" id="currentPic" class="swiper-lazy" src="" alt=""><div class="swiper-lazy-preloader"></div></li>
        </ul>
        <div class="photoViewer-bottom">
            <div onclick="closeViewCommon()" class="closeViewer"></div>
            <div class="swiper-pagination"></div>
            <div onclick="downloadPicCommon(event)" class="download"></div>
        </div>
    </div>
</div>


</body>

</html>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/common.js"></script>
<script type="text/javascript" src="../../script/clipboard.min.js"></script>
<link rel="stylesheet" type="text/css" href="../../css/mescroll.min.css"/>
<script type="text/javascript" src="../../script/mescroll.min.js"></script>
<script type="text/javascript" src="../../script/detailSwiper.js"></script>

<script type="text/javascript" src="../../script/comment.js"></script>


<script type="text/javascript">
    var type = 1;
    var page = 1;//页码
    var activity_id = '';//活动id
    var _model = $(".model");
    var shareTitle = '';//分享title
    var shareInfo = '';//分享info
    var shareImg = 'widget://icon/logo.png';//分享图片
    var pullUp = true;
    var video_id = 0;
    var msgImg_id = 0;
    apiready = function () {
        $api.fixStatusBar($api.dom('#header'));
        api.setStatusBarStyle({
            style: 'light', //设置APP状态栏字体色
            color: 'rgba(255,255,255,0)', //设置APP状态栏背景色
        });
        //setFixStatusBar(); //设置状态栏

        activity_id = api.pageParam.activity_id;
        keybackListener()
        pop.loading()


        getActivityDetail(1)

        //监听报名
        api.addEventListener({
            name: 'signUped'
        }, function (ret, err) {
            getActivityDetail(1)
        });

        SystemCheckVersion()

        api.addEventListener({
            name: 'aite'
        }, function(ret, err) {
            console.log(JSON.stringify(ret.value));
            var mid = ret.value.id;
            var mname = ret.value.name;
            var mUrl = '../activity/person_index';
            var m_id = {member_id: mid}
            var word = '<span style="display: inline; color: #ff7777;" class="aite" data-id="'+mid+'" onclick=\'commonUrl("'+mUrl+'",'+jsonChange(m_id)+')\'>@'+mname+'</span>　';
            // $("#article").append(word);
            checkSystemType(function () {
                $("#article").append(word);
            },function () {
                _insertimg(word)
            });
        });

    };
    function comeBackBar() {
        api.historyBack({}, function (ret, err) {
            if (!ret.status) {
                api.closeWin();
                setFixStatusBar(); //设置状态栏
            }
        });
    }


    function toAllList() {
        //type: 1新闻，2帖子，3活动贴，4赛事，5战况，6投票，7广场评星
        getAllList(3,news_id)
    }


    //二级评论获取评论目标
    var _input = $("#inputContent");
    var _editModel = $(".edit-model");
    var _article = $("#article");
    _input.click(function () {
        _editModel.show();
        var html = _article.html()
        _article.html('').focus();
    });

    function reply(id, name) {
        var pid = id;
        _input.attr('placeholder', '回复：' + name);
        _input.attr('data-pid', pid);
        _editModel.show();
        _article.focus();
        console.log(pid)
    }



    //关闭评论框
    _editModel.on('click', function () {
        _input.val('');
        _input.attr('placeholder', '写评论...');
        _input.attr('data-pid', '');
        _editModel.hide()
    });
    //阻止事件冒泡 关闭评论框
    _editModel.on('click', '.edit-input', function (event) {
        event.stopPropagation()
        /*_article.focus();*/
    });

    //评论
    var addStatus = true;
    function comment_add() {
        var pid = '', type = 3;
        if (_input.attr('data-pid')) {
            pid = _input.attr('data-pid');
            type = 0;
        }
        var uidsArr = [];
        $("#article .aite").each(function () {
            var _this = $(this);
            var _thisId = _this.attr('data-id');
            uidsArr.push(_thisId);
        });
        var param = {
            token: $api.getStorage('token'),
            type: type,//类型：1新闻 2帖子 3活动 0回复 4赛事，5战况，6投票，7广场
            key_id: activity_id,
            content: _article.html(),
            pid: pid,//当type为0的时候必须传入,二级回复，就是评论的id
            icon: msgImg_id,
            void_id: video_id,
            uids: uidsArr.toString()
        }
        if (!isDefine(param.content)&&!isDefine(param.icon)&&!isDefine(param.void_id)) {
            pop.notice('请发表你的评论内容');
            return false;
        }
        if(addStatus == false){
            return;
        }
        console.log(jsonChange(param));
        // return;
        pop.loading();
        getAjax(Interface.comment_add, param, function (res) {
            addStatus = false;

            _editModel.hide();
            _article.html('');
            _input.attr('placeholder', '写评论...');
            _input.attr('data-pid', '');

            $("#msgImg").siblings('img').attr('src','').removeAttr('data-id');
            $("#msgImg").hide();
            msgImg_id = 0;
            video_id = 0;

            pop.notice(res.msg)
            pop.close();
            setTimeout(function () {
                page = 1;
                getActivityDetail()
                addStatus = true;
            }, 1500)
        }, function (error) {
            pop.notice(error.msg)
            pop.close();
        })
        _article.blur();//失去焦点
    }



    /*/!*下拉刷新的回调 *!/
    function downCallback() {
        stype = 1;
        hot = 1;
        page = 1;
        getInviteDetail()

        //mescroll.endErr();
    }*/

    //创建MeScroll对象
    var mescroll = new MeScroll("mescroll", {
        down: {
            isLock: true,
            use: false,
            auto: false, //是否在初始化完毕之后自动执行下拉回调callback; 默认true
            // callback: downCallback //下拉刷新的回调
        },
        up: {
            auto: false, //是否在初始化时以上拉加载的方式自动加载第一页数据; 默认false
            isBounce: true, //此处禁止ios回弹,解析(务必认真阅读,特别是最后一点): http://www.mescroll.com/qa.html#q10
            callback: upCallback, //上拉回调,此处可简写; 相当于 callback: function (page) { upCallback(page); }
            /*toTop:{ //配置回到顶部按钮
                src : "../res/img/mescroll-totop.png", //默认滚动到1000px显示,可配置offset修改
                //offset : 1000
            }*/
        }
    });

    /*上拉加载的回调 */
    function upCallback() {
        if (pullUp == true) {
            getActivityDetail()

        } else {
            mescroll.endErr();
        }
    }

    //刷新页面
    function loadPage() {
        page = 1;
        getActivityDetail();
    }

    //举报
    function reportBtn(event) {
        event.stopPropagation()
        var param = {
            type: 4,
            pid: activity_id,
        }
        commonUrl('../member/jubao',param);
        closeModel()
    }


    function tabComment(tab, that) {
        $(that).addClass('on').siblings('li').removeClass('on');
        if (tab == 1) {
            $('.love-list').hide().siblings(".comment-list").show();
            type = 1;
            page = 1;
            getActivityDetail()
        } else {
            $(".comment-list").hide().siblings('.love-list').show()
            type = 2;
            page = 1;
            getActivityDetail()
        }
    }


    //活动详情
    function getActivityDetail() {
        var param = {
            token: $api.getStorage('token'),
            activity_id: activity_id,
            type: type,//类型：1评论列表 2报名人列表
            page: page,
        }
        getAjax(Interface.activity_details, param, function (res) {
            console.log(jsonChange(res))
            var data = res.data.activity;
            if (isDefine(data)) {
                var userInfo = data.member;

                shareTitle = data.title;
                shareInfo = data.content;
                if(isDefine(data.background_path)){
                    shareImg = ajaxUrl + data.background_path
                }

                $("#title").html(data.title);
                $("#content").html(data.content);
                $("#content .a_img").each(function () {
                    var _this = $(this);
                    _this.attr('href','javascript:void(0);')
                });
                console.log(data.content)
                $("#activity_img").css({
                    background: 'url(' + ajaxUrl + data.background_path + ')'
                });

                $("#activity_time").html(data.week + ' ' + data.start_time + ' - ' + data.end_time);
                $("#sign_time").html(data.sign_time)
                $(".city").html(data.address);
				$("#address").attr("lat",data.lat);
				$("#address").attr("log",data.log);
                $("#username").html(userInfo.name);
                $("#tel").html(data.tel);
                $("#num").html(data.sum_number + '/' + data.number);
                $("#cost").html(data.cost);

                if (data.status == 1) {
                    if (res.data.stype == 1) {
                        $("#sign1").show().siblings('.sign-up').hide()
                    } else if (res.data.stype == 3) {
                        $("#sign2").show().siblings('.sign-up').hide()
                    } else {
                        $("#sign3").show().siblings('.sign-up').hide()
                    }
                } else if (data.status == 4) {
                    //活动报名截止
                    $('#sign4').show().siblings('.sign-up').hide()
                } else if (data.status == 2) {
                    //活动进行中
                    $('#sign5').show().siblings('.sign-up').hide()
                } else if (data.status == 3) {
                    //活动已结束
                    $('#sign6').show().siblings('.sign-up').hide()
                } else if (data.status == 0) {
                    //活动已取消
                    $('#sign7').show().siblings('.sign-up').hide()
                }

                //分享
                $("#zf").html(data.share_number)
                //点赞
                $("#love").html(data.fabulous_number)
                if (data.fabulous_status == 1) {
                    $("#love").addClass('on')
                } else {
                    $("#love").removeClass('on')
                }


                //报名人数
                $("#signNum").html(data.sum_number)

                //评论量
                $("#plNum").html(data.comment_number)
                $("#msg").html(data.comment_number)

                var comment = data.comment;
                if (type == 1) {
                    var commentHtml = '';
                    if (isDefine(comment)) {

                        commentHtml = getEvaluteList(comment,activity_id)

                        if (page == 1) {
                            $("#commentHtml").html(commentHtml)
                        } else {
                            $("#commentHtml").append(commentHtml)
                        }
                        page++;
                        pullUp = true;
                        SystemCheckVersion()
                    } else {
                        if (page == 1) {
                            $("#commentHtml").html(noData)
                        }
                        pullUp = false;
                    }
                } else {
                    var signList = data.sign_up;
                    var signHtml = '';
                    if (isDefine(signList)) {
                        for (var i = 0; i < signList.length; i++) {
                            var autograph = '';
                            if (signList[i].autograph == '' || signList[i].autograph == 0) {
                                autograph = commonNote;
                            } else {
                                autograph = signList[i].autograph
                            }

                            var signBadge = '';
                            if (isDefine(signList[i].badge_path)) {
                                for (var a = 0; a < signList[i].badge_path.length; a++) {
                                    signBadge += '<dd class="icon"><img src="' + ajaxUrl + signList[i].badge_path[a] + '" alt=""></dd>';
                                }
                            }


                            var userHtml = '';
                            userHtml = '<div class="user-info">' +
                                '            <div class="userRelative"><div class="user-icon bg-cover" style="background-image: url(' + ajaxUrl + signList[i].icon_path + ');"></div><span class="vip"></span></div>' +
                                // '            <div class="user-icon bg-cover" style="background-image: url(' + ajaxUrl + list[i].icon_path + ');"></div>' +
                                '                            <div class="info">' +
                                '                                <div class="name">' +
                                '                                    <h6>'+signList[i].name+'</h6>' +
                                '                                    <dl class="badge-list" tapmode onclick="toBadgePage(event)">' + signBadge + '</dl>' +
                                '                                </div>' +
                                '                                <p class="sign-info single-ellipsis">' + autograph + '</p>' +
                                // '                                <span class="time">3分钟前</span>' +
                                '                            </div>' +
                                '                        </div>';


                            if (data.status == 1 && res.data.stype == 1) {
                                var param = {"activity_id": activity_id};
                                signHtml += '<li><div class="common-user-detail" tapmode onclick=\'commonUrl("../activity/activity_member",' + jsonChange(param) + ')\'>' + userHtml + '</div></li>';
                            } else {
                                var user_id = $api.getStorage('userInfo').id;
                                if (signList[i].id == user_id) {
                                    var mUrl = '../member/member';
                                } else {
                                    var mUrl = '../activity/person_index';
                                    param = {member_id: signList[i].id}
                                }
                                signHtml += '<li><div class="common-user-detail" tapmode onclick=\'commonUrl("'+mUrl+'",' + jsonChange(param) + ')\'>' + userHtml + '</div></li>';
                            }

                        }

                        $("#sign_list").html(signHtml)
                    } else {
                        $("#sign_list").html(noData)
                    }


                }

            }

            mescroll.endErr();

            pop.close();
        }, function (error) {
            pop.notice(error.msg)
            pop.close();
            mescroll.endErr();
        })
    }

    //查看活动详情
    function activityDetail(path) {
        var pathArr = path.split('/');
        var pathName = pathArr[pathArr.length - 1];
        console.log('当前链接路径：' + jsonChange(path) + '，跳转传参：activity_id:' + activity_id);
        api.openWin({
            name: pathName,
            url: path + '.html',
            reload: true,
            pageParam: {
                activity_id: activity_id
            }
        });
    }

    //活动报名
    function userSignAct(path) {
        signAct(path, activity_id);
    }

    //取消活动
    function userCancelAct() {
        pop.loading();
        cancelAct(activity_id, function (res) {
            pop.notice(res.msg)
            pop.close();
            setTimeout(function () {
                comeBack()
            }, 2000)
        })
    }

    //取消活动报名
    function userCancelSign() {
        pop.loading();
        cancelSign(activity_id, function (res) {
            pop.notice(res.msg)
            pop.close();
            setTimeout(function () {
                page = 1;
                getActivityDetail()
            }, 1000)
        })
    }

    //点赞或者取消点赞 类型type：1新闻 2帖子 3活动 4评论
    function clickFabulous(f_stype, type, pid,event) {
        event.stopPropagation()
        //活动点赞
        if (type == 3) {
            pid = activity_id;
            if ($('#love').hasClass('on')) {
                f_stype = 2
            } else {
                f_stype = 1
            }
        }
        fabulous(f_stype, type, pid, function (res) {
            if (f_stype == 1) {
                pop.notice('点赞成功')
            } else {
                pop.notice('取消点赞')
            }
            setTimeout(function () {
                page = 1;
                getActivityDetail()
            }, 500)
        })
    }


    //开启弹窗
    function openModel() {
        _model.addClass('showModel');
        setTimeout(function () {
            _model.find('.action-view').addClass('showView');
        }, 10)
    }

    //阻止事件冒泡
    function stopModel(event) {
        event.stopPropagation();
    }

    //关闭弹窗
    function closeModel(event) {
        if (event) {
            event.stopPropagation();
        }
        _model.find('.action-view').removeClass('showView');
        setTimeout(function () {
            _model.removeClass('showModel');
        }, 500)
    }

    /*$(document).ready(function(){

        $(window).scroll(function(event){
            var winPos = $(window).scrollTop();
            if(winPos>0){
                $(".header").addClass('headerFixed');
                api.setStatusBarStyle({
                    style: 'dark', //设置APP状态栏字体色
                    color: '#fff', //设置APP状态栏背景色
                });
            }else {
                $(".header").removeClass('headerFixed');
                api.setStatusBarStyle({
                    style: 'light', //设置APP状态栏字体色
                    color: 'rgba(255,255,255,0)', //设置APP状态栏背景色
                });
            }
        });

    })*/

    function copyLink() {
        var text = ajaxUrl + '/api/share/news?type=4&id='+activity_id;
        copy(text);
    }


    //scene:session（会话）timeline（朋友圈）favorite（收藏）
    //title:标题
    //thumb 图标
    //contentUrl 分享的地址
    //type：1新闻 2帖子 3赛况 4活动

    //微信好友分享
    function shareWx(){
        var p = {
            apiKey: '',
            scene: 'session',
            title: shareTitle,
            thumb: 'widget://icon/logo.png',
            description:shareInfo,
            contentUrl: ajaxUrl + '/api/share/news?type=4&id='+activity_id
        };
        wxpyqFX(p);
    }
    //朋友圈
    function shareWxq(){
        var p = {
            apiKey: '',
            scene: 'timeline',
            title: shareTitle,
            thumb: 'widget://icon/logo22.png',
            description:shareInfo,
            contentUrl:ajaxUrl + '/api/share/news?type=4&id='+activity_id,
        };
        wxpyqFX(p);
    }
    //qq好友
    function shareQq(){
        var p = {
            url: ajaxUrl + '/api/share/news?type=4&id='+activity_id,
            title: shareTitle,
            description: shareInfo,
            imgUrl: shareImg,
            type:'QFriend'
        }
        qqfx(p);
    }

    //qq空间
    function shareQzone(){
        var p = {
            url: ajaxUrl + '/api/share/news?type=4&id='+activity_id,
            title: shareTitle,
            description: shareInfo,
            imgUrl: shareImg,
            type:'QZone'
        }
        qqfx(p);
    }

    //微博
    function shareWb(){
        var p = {
            apiKey: '',
            scene: 'session',
            title: shareTitle,
            description: shareInfo,
            thumb: 'widget://icon/logo22.png',
            contentUrl:ajaxUrl+ '/api/share/news?type=4&id='+activity_id,
        };
        weibo_authorize(p);
    }
	//跳转地方查看
	/*$("#address").click(function(){
		var lat =$(this).attr("lat");
		var log =$(this).attr("log");
		console.log(lat +"===="+log);
		var param ={
			lat:lat,
			log:log,
		}
		commonUrl('show_map', param)

	});*/

</script>
